import type { RouteRecordRaw } from 'vue-router'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'home',
    redirect: { name: 'goods' },
  },
  {
    path: '/login',
    name: 'login',
    component: () => import('@/views/login/index.vue'),
    // 基于路由的动态过渡
    meta: { position: '', title: '登录', isRequireAuth: false, hidden: false, transition: '' },
  },
  {
    path: '/mouse',
    name: 'mouse',
    component: () => import('@/views/mouse/index.vue'),
    meta: { position: 'header', title: 'Mouse', isRequireAuth: true, hidden: false, transition: 'fade' },
  },
  {
    path: '/todo',
    name: 'todo',
    component: () => import('@/views/todo/index.vue'),
    meta: { position: 'header', title: 'Todo', isRequireAuth: true, hidden: false, transition: 'fade' },
  },
  {
    path: '/goods',
    name: 'goods',
    component: () => import('@/views/goods/index.vue'),
    meta: { position: 'aside', title: '商品列表', isRequireAuth: true, hidden: false, transition: 'fade' },
  },
  {
    path: '/user',
    name: 'user',
    component: () => import('@/views/user/index.vue'),
    meta: { position: 'aside', title: '用户列表', isRequireAuth: true, hidden: false, transition: 'fade' },
  },
  {
    path: '/role',
    name: 'role',
    component: () => import('@/views/role/index.vue'),
    meta: { position: 'aside', title: '角色列表', isRequireAuth: true, hidden: false, transition: 'fade' },
  },
  {
    path: '/authority',
    name: 'authority',
    component: () => import('@/views/authority/index.vue'),
    meta: { position: 'aside', title: '权限列表', isRequireAuth: true, hidden: false, transition: 'fade' },
  },
]

export default routes
